﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web7.Ioc;

namespace Web7.Core.Security
{
    public interface IAssistRoleService<Tid> : IDependency
    {

        void CreatePermissionForRole(string roleName, string permissionName);

        IDictionary<string, IEnumerable<PermissionRecord>> GetInstalledPermissions();

        IEnumerable<PermissionRecord> GetPermissionsForRole(Tid id);

        IEnumerable<PermissionRecord> GetPermissionsForRoleByName(string name);

        /// <summary>
        /// Verify if the role name is unique
        /// </summary>
        /// <param name="name">Role name</param>
        /// <returns>Returns false if a role with the given name already exits</returns>
        bool VerifyRoleUnicity(string name);

		/*
		 * Note: 考虑将其他实体类型接口的此成员也重构为泛型方式
		 */
		Role CreateRole<T>(T model);
    }

    public interface IAssistRoleService : IAssistRoleService<Guid>
    { 

    }
}
